export const initBoardChessman = [
  {
    chessName: "車",
    camp: "black",
    x: 8,
    y: 0,
    key: "mr9NyxeItu",
    isChecked: false,
    chessId: 0,
  },
  {
    chessName: "車",
    camp: "black",
    x: 0,
    y: 0,
    key: "K1Tvu4AIv5",
    isChecked: false,
    chessId: 0,
  },
  {
    chessName: "馬",
    camp: "black",
    x: 7,
    y: 0,
    key: "B8VHQh5f0A",
    isChecked: false,
    chessId: 1,
  },
  {
    chessName: "馬",
    camp: "black",
    x: 1,
    y: 0,
    key: "8QWzFo7oJZ",
    isChecked: false,
    chessId: 1,
  },
  {
    chessName: "象",
    camp: "black",
    x: 6,
    y: 0,
    key: "OVB4pg4uO7",
    isChecked: false,
    chessId: 2,
  },
  {
    chessName: "象",
    camp: "black",
    x: 2,
    y: 0,
    key: "6KACL3V5o1",
    isChecked: false,
    chessId: 2,
  },
  {
    chessName: "士",
    camp: "black",
    x: 5,
    y: 0,
    key: "IUmJ9tf407",
    isChecked: false,
    chessId: 3,
  },
  {
    chessName: "士",
    camp: "black",
    x: 3,
    y: 0,
    key: "54BK16okBy",
    isChecked: false,
    chessId: 3,
  },
  {
    chessName: "将",
    camp: "black",
    x: 4,
    y: 0,
    key: "5GZvKH5MDd",
    isChecked: false,
    chessId: 4,
  },
  {
    chessName: "炮",
    camp: "black",
    x: 1,
    y: 2,
    key: "ewJOwsA12A",
    isChecked: false,
    chessId: 5,
  },
  {
    chessName: "炮",
    camp: "black",
    x: 7,
    y: 2,
    key: "EmQKjeJZjL",
    isChecked: false,
    chessId: 5,
  },
  {
    chessName: "卒",
    camp: "black",
    x: 0,
    y: 3,
    key: "aQqlaS18EG",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "卒",
    camp: "black",
    x: 2,
    y: 3,
    key: "ofbolhJ34U",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "卒",
    camp: "black",
    x: 4,
    y: 3,
    key: "SId3UXUT6z",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "卒",
    camp: "black",
    x: 6,
    y: 3,
    key: "bR6omrQKRh",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "卒",
    camp: "black",
    x: 8,
    y: 3,
    key: "0M63F934h7",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "車",
    camp: "red",
    x: 8,
    y: 9,
    key: "CAOsQIjJva",
    isChecked: false,
    chessId: 0,
  },
  {
    chessName: "車",
    camp: "red",
    x: 0,
    y: 9,
    key: "GeNJCbQ2D8",
    isChecked: false,
    chessId: 0,
  },
  {
    chessName: "馬",
    camp: "red",
    x: 7,
    y: 9,
    key: "zA2P6R3229",
    isChecked: false,
    chessId: 1,
  },
  {
    chessName: "馬",
    camp: "red",
    x: 1,
    y: 9,
    key: "6XbY5WI0DD",
    isChecked: false,
    chessId: 1,
  },
  {
    chessName: "相",
    camp: "red",
    x: 6,
    y: 9,
    key: "7oG32GN8Q6",
    isChecked: false,
    chessId: 2,
  },
  {
    chessName: "相",
    camp: "red",
    x: 2,
    y: 9,
    key: "4voi1DmkTV",
    isChecked: false,
    chessId: 2,
  },
  {
    chessName: "仕",
    camp: "red",
    x: 5,
    y: 9,
    key: "36455Sv8K0",
    isChecked: false,
    chessId: 3,
  },
  {
    chessName: "仕",
    camp: "red",
    x: 3,
    y: 9,
    key: "Pj4EZCH8nv",
    isChecked: false,
    chessId: 3,
  },
  {
    chessName: "帥",
    camp: "red",
    x: 4,
    y: 9,
    key: "1RRev9T3z1",
    isChecked: false,
    chessId: 4,
  },
  {
    chessName: "砲",
    camp: "red",
    x: 1,
    y: 7,
    key: "J6e7Q0ZK50",
    isChecked: false,
    chessId: 5,
  },
  {
    chessName: "砲",
    camp: "red",
    x: 7,
    y: 7,
    key: "AEVU0BGIeN",
    isChecked: false,
    chessId: 5,
  },
  {
    chessName: "兵",
    camp: "red",
    x: 0,
    y: 6,
    key: "Cf3c3IZ1QK",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "兵",
    camp: "red",
    x: 2,
    y: 6,
    key: "AvenvO3oBe",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "兵",
    camp: "red",
    x: 4,
    y: 6,
    key: "Fb42eSOP91",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "兵",
    camp: "red",
    x: 6,
    y: 6,
    key: "7BU4m65l20",
    isChecked: false,
    chessId: 6,
  },
  {
    chessName: "兵",
    camp: "red",
    x: 8,
    y: 6,
    key: "I558bh56O0",
    isChecked: false,
    chessId: 6,
  },
];

function createKey() {
  let key = "";
  const en = [
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
  ];
  const EN = [
    "A",
    "B",
    "C",
    "D",
    "E",
    "F",
    "G",
    "H",
    "I",
    "J",
    "K",
    "L",
    "M",
    "N",
    "O",
    "P",
    "Q",
    "R",
    "S",
    "T",
    "U",
    "V",
    "W",
    "X",
    "Y",
    "Z",
  ];
  const nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
  for (let i = 0; i < 10; i++) {
    const typeRandom = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    switch (typeRandom) {
      case 1:
        key += en[Math.floor(Math.random() * (en.length - 0))];
        break;
      case 2:
        key += EN[Math.floor(Math.random() * (EN.length - 0))];
        break;
      case 3:
        key += nums[Math.floor(Math.random() * (nums.length - 0))];
        break;

      default:
        break;
    }
  }
  return key;
}
